import 'package:get/get.dart';
import 'package:razer_one/app/main/utils/app_manager.dart';
import 'package:razer_one/app/routes/app_routes.dart';

class LaunchController extends GetxController {
  @override
  void onInit() {
    super.onInit();
    config();
  }

  config() async {
    String? userName = await AppManager.instance.account;
    String? passWord = await AppManager.instance.passWord;
    //发起请求
    if (userName != null && passWord != null) {
      Get.offAllNamed(AppRoutes.initialRoute);
    } else {
      Future.delayed(const Duration(seconds: 2), () {
        Get.offAllNamed(AppRoutes.loginRoute);
      });
    }
  }
}
